package org.kgc.alanhealth.service.impl;

import lombok.Data;
import org.kgc.alanhealth.entity.HospitalBill;
import org.kgc.alanhealth.mapper.HospitalBillMapper;
import org.kgc.alanhealth.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    HospitalBillMapper orderMapper;

    @Override
    public boolean insert(HospitalBill record) {
        return orderMapper.insert(record) > 0;

    }

    @Override
    public boolean updateOrder(HospitalBill bill) {
        bill.setStatus(2);
        return orderMapper.updateByPrimaryKeySelective(bill)>0;
    }

    @Override
    public boolean updateOrder1(HospitalBill bill) {
        bill.setStatus(5);
        return orderMapper.updateByPrimaryKeySelective(bill)>0;
    }

    @Override
    public List<HospitalBill> selectByStatus(HospitalBill bill) {
        return orderMapper.selectByStatus(bill);
    }
}
